<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <a th:href="@{/testAjax}" @click="testAjax">testAjax</a><br>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<script>
    const vue = new Vue({
        el:"app",
        methods: {
            testAjax:function (event){
                axios({
                    method:"get",
                    url:event.target.href,
                }).then(function (res){
                    alert(res.data)
                })
                event.preventDefault();
            }
        }
    })
</script>
</html>